home *** CD-ROM | disk | FTP | other *** search
/ Dynamic HTML Construction Kit / Dynamic HTML Construction Kit.iso / source_code / tydhtml / dyn.exe / CHAP09 / dyn9_2.txt < prev    next >
Encoding:
Text File  |  1997-10-02  |  1.2 KB  |  47 lines

  1. <HTML>
  2.  
  3. <HEAD>
  4.  
  5. <FONT FACE="verdana,arial,helvetica" SIZE=2>
  6.  
  7. <TITLE>Planetary Trivia</TITLE>
  8.  
  9. </HEAD>
  10.  
  11. <BODY BGCOLOR="#FFFFFF">
  12.  
  13. <H2>Planetary Trivia</H2>
  14.  
  15. <HR>
  16.  
  17. <BR>
  18.  
  19. <H3><P ID=Q1 STYLE="color:Blue">
  20.  
  21. <B>Question 1: </B>
  22.  
  23. <P>
  24.  
  25. Which of the following planets reflects the highest percentage 
  26.  
  27. of light it receives from the sun?
  28.  
  29. </H3>
  30.  
  31. <BR>
  32.  
  33. <TABLE>
  34.  
  35. <TR><TD><IMG SRC="mars.gif" ID=A11 onclick="Answer1();"></TD>
  36.  
  37. <TD><IMG SRC="venus.gif" ID=A12 onclick="Answer1();"></TD>
  38.  
  39. <TD><IMG SRC="saturn.gif" ID=A13 onclick="Answer1();"></TD>
  40.  
  41. <TD><IMG SRC="uranus.gif" ID=A14 onclick="Answer1();"></TD></TR>
  42.  
  43. </TABLE>
  44.  
  45. <P ID=A1></P>
  46.  
  47.  
  48.  
  49. <SCRIPT LANGUAGE=JavaScript>
  50.  
  51. var srcElement
  52.  
  53. function Answer1() {
  54.  
  55.   srcElement = window.event.srcElement;
  56.  
  57.   if (Q1.style.color=="blue") {
  58.  
  59.      if (srcElement.id=="A12") {
  60.  
  61.         srcElement.src = "correct.gif";
  62.  
  63.         Q1.style.color= "Green";
  64.  
  65.      } else {
  66.  
  67.         srcElement.src = "wrong.gif";
  68.  
  69.         Q1.style.color= "Red";
  70.  
  71.      }
  72.  
  73.      A1.innerHTML="<B>Venus</B> has an albedo of 59% " +
  74.  
  75.           "which is much higher than the other answers";
  76.  
  77.   }
  78.  
  79. }
  80.  
  81. </SCRIPT>
  82.  
  83.  
  84.  
  85. <HR>
  86.  
  87. </FONT>
  88.  
  89. </BODY>
  90.  
  91. </HTML>
  92.  
  93.